package com.zj.fx.model.month;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import cn.hutool.core.util.StrUtil;

/**
 * 月评价任务驳回操作记录明细 MonthRejectDtlExample
 *
 * @author SQL_自动生成
 * @date 2023-07-13 10:53:28
 */
public class MonthRejectDtlExample {

    protected String orderByClause;

    protected boolean distinct;

    protected List<Criteria> oredCriteria;

    public MonthRejectDtlExample() {
        oredCriteria = new ArrayList<Criteria>();
    }

    public void setOrderByClause(String orderByClause) {
        this.orderByClause = orderByClause;
    }

    public String getOrderByClause() {
        return orderByClause;
    }

    public void setDistinct(boolean distinct) {
        this.distinct = distinct;
    }

    public boolean isDistinct() {
        return distinct;
    }

    public List<Criteria> getOredCriteria() {
        return oredCriteria;
    }

    public void or(Criteria criteria) {
        oredCriteria.add(criteria);
    }

    public Criteria or() {
        Criteria criteria = createCriteriaInternal();
        oredCriteria.add(criteria);
        return criteria;
    }

    public Criteria createCriteria() {
        Criteria criteria = createCriteriaInternal();
        if (oredCriteria.size() == 0) {
            oredCriteria.add(criteria);
        }
        return criteria;
    }

    protected Criteria createCriteriaInternal() {
        Criteria criteria = new Criteria();
        return criteria;
    }

    public void clear() {
        oredCriteria.clear();
        orderByClause = null;
        distinct = false;
    }

    protected abstract static class GeneratedCriteria {
        protected List<Criterion> criteria;

        protected GeneratedCriteria() {
            super();
            criteria = new ArrayList<Criterion>();
        }

        public boolean isValid() {
            return criteria.size() > 0;
        }

        public List<Criterion> getAllCriteria() {
            return criteria;
        }

        public List<Criterion> getCriteria() {
            return criteria;
        }

        protected void addCriterion(String condition) {
            if (condition == null) {
                throw new RuntimeException("Value for condition cannot be null");
            }
            criteria.add(new Criterion(condition));
        }

        protected void addCriterion(String condition, Object value, String property) {
            if (value == null) {
                throw new RuntimeException("Value for " + property + " cannot be null");
            }
            criteria.add(new Criterion(condition, value));
        }

        protected void addCriterion(String condition, Object value1, Object value2, String property) {
            if (value1 == null || value2 == null) {
                throw new RuntimeException("Between values for " + property + " cannot be null");
            }
            criteria.add(new Criterion(condition, value1, value2));
        }


        public Criteria andIdIsNull() {
            addCriterion("id is null");
            return (Criteria) this;
        }

        public Criteria andIdIsNotNull() {
            addCriterion("id is not null");
            return (Criteria) this;
        }

        public Criteria andIdEqualTo(String value) {
            addCriterion("id =", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdNotEqualTo(String value) {
            addCriterion("id <>", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdGreaterThan(String value) {
            addCriterion("id >", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdGreaterThanOrEqualTo(String value) {
            addCriterion("id >=", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdLessThan(String value) {
            addCriterion("id <", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdLessThanOrEqualTo(String value) {
            addCriterion("id <=", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdLike(String value) {
            addCriterion("id like", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdNotLike(String value) {
            addCriterion("id not like", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdIn(List<String> values) {
            addCriterion("id in", values, "id");
            return (Criteria) this;
        }

        public Criteria andIdNotIn(List<String> values) {
            addCriterion("id not in", values, "id");
            return (Criteria) this;
        }

        public Criteria andIdBetween(String value1, String value2) {
            addCriterion("id between", value1, value2, "id");
            return (Criteria) this;
        }

        public Criteria andIdNotBetween(String value1, String value2) {
            addCriterion("id not between", value1, value2, "id");
            return (Criteria) this;
        }


        public Criteria andFkTaskIdIsNull() {
            addCriterion("fk_task_id is null");
            return (Criteria) this;
        }

        public Criteria andFkTaskIdIsNotNull() {
            addCriterion("fk_task_id is not null");
            return (Criteria) this;
        }

        public Criteria andFkTaskIdEqualTo(String value) {
            addCriterion("fk_task_id =", value, "fkTaskId");
            return (Criteria) this;
        }

        public Criteria andFkTaskIdNotEqualTo(String value) {
            addCriterion("fk_task_id <>", value, "fkTaskId");
            return (Criteria) this;
        }

        public Criteria andFkTaskIdGreaterThan(String value) {
            addCriterion("fk_task_id >", value, "fkTaskId");
            return (Criteria) this;
        }

        public Criteria andFkTaskIdGreaterThanOrEqualTo(String value) {
            addCriterion("fk_task_id >=", value, "fkTaskId");
            return (Criteria) this;
        }

        public Criteria andFkTaskIdLessThan(String value) {
            addCriterion("fk_task_id <", value, "fkTaskId");
            return (Criteria) this;
        }

        public Criteria andFkTaskIdLessThanOrEqualTo(String value) {
            addCriterion("fk_task_id <=", value, "fkTaskId");
            return (Criteria) this;
        }

        public Criteria andFkTaskIdLike(String value) {
            addCriterion("fk_task_id like", value, "fkTaskId");
            return (Criteria) this;
        }

        public Criteria andFkTaskIdNotLike(String value) {
            addCriterion("fk_task_id not like", value, "fkTaskId");
            return (Criteria) this;
        }

        public Criteria andFkTaskIdIn(List<String> values) {
            addCriterion("fk_task_id in", values, "fkTaskId");
            return (Criteria) this;
        }

        public Criteria andFkTaskIdNotIn(List<String> values) {
            addCriterion("fk_task_id not in", values, "fkTaskId");
            return (Criteria) this;
        }

        public Criteria andFkTaskIdBetween(String value1, String value2) {
            addCriterion("fk_task_id between", value1, value2, "fkTaskId");
            return (Criteria) this;
        }

        public Criteria andFkTaskIdNotBetween(String value1, String value2) {
            addCriterion("fk_task_id not between", value1, value2, "fkTaskId");
            return (Criteria) this;
        }


        public Criteria andRejectDateIsNull() {
            addCriterion("reject_date is null");
            return (Criteria) this;
        }

        public Criteria andRejectDateIsNotNull() {
            addCriterion("reject_date is not null");
            return (Criteria) this;
        }

        public Criteria andRejectDateEqualTo(Date value) {
            addCriterion("reject_date =", value, "rejectDate");
            return (Criteria) this;
        }

        public Criteria andRejectDateNotEqualTo(Date value) {
            addCriterion("reject_date <>", value, "rejectDate");
            return (Criteria) this;
        }

        public Criteria andRejectDateGreaterThan(Date value) {
            addCriterion("reject_date >", value, "rejectDate");
            return (Criteria) this;
        }

        public Criteria andRejectDateGreaterThanOrEqualTo(Date value) {
            addCriterion("reject_date >=", value, "rejectDate");
            return (Criteria) this;
        }

        public Criteria andRejectDateLessThan(Date value) {
            addCriterion("reject_date <", value, "rejectDate");
            return (Criteria) this;
        }

        public Criteria andRejectDateLessThanOrEqualTo(Date value) {
            addCriterion("reject_date <=", value, "rejectDate");
            return (Criteria) this;
        }

        public Criteria andRejectDateLike(Date value) {
            addCriterion("reject_date like", value, "rejectDate");
            return (Criteria) this;
        }

        public Criteria andRejectDateNotLike(Date value) {
            addCriterion("reject_date not like", value, "rejectDate");
            return (Criteria) this;
        }

        public Criteria andRejectDateIn(List<Date> values) {
            addCriterion("reject_date in", values, "rejectDate");
            return (Criteria) this;
        }

        public Criteria andRejectDateNotIn(List<Date> values) {
            addCriterion("reject_date not in", values, "rejectDate");
            return (Criteria) this;
        }

        public Criteria andRejectDateBetween(Date value1, Date value2) {
            addCriterion("reject_date between", value1, value2, "rejectDate");
            return (Criteria) this;
        }

        public Criteria andRejectDateNotBetween(Date value1, Date value2) {
            addCriterion("reject_date not between", value1, value2, "rejectDate");
            return (Criteria) this;
        }


        public Criteria andRejectReasonIsNull() {
            addCriterion("reject_reason is null");
            return (Criteria) this;
        }

        public Criteria andRejectReasonIsNotNull() {
            addCriterion("reject_reason is not null");
            return (Criteria) this;
        }

        public Criteria andRejectReasonEqualTo(String value) {
            addCriterion("reject_reason =", value, "rejectReason");
            return (Criteria) this;
        }

        public Criteria andRejectReasonNotEqualTo(String value) {
            addCriterion("reject_reason <>", value, "rejectReason");
            return (Criteria) this;
        }

        public Criteria andRejectReasonGreaterThan(String value) {
            addCriterion("reject_reason >", value, "rejectReason");
            return (Criteria) this;
        }

        public Criteria andRejectReasonGreaterThanOrEqualTo(String value) {
            addCriterion("reject_reason >=", value, "rejectReason");
            return (Criteria) this;
        }

        public Criteria andRejectReasonLessThan(String value) {
            addCriterion("reject_reason <", value, "rejectReason");
            return (Criteria) this;
        }

        public Criteria andRejectReasonLessThanOrEqualTo(String value) {
            addCriterion("reject_reason <=", value, "rejectReason");
            return (Criteria) this;
        }

        public Criteria andRejectReasonLike(String value) {
            addCriterion("reject_reason like", value, "rejectReason");
            return (Criteria) this;
        }

        public Criteria andRejectReasonNotLike(String value) {
            addCriterion("reject_reason not like", value, "rejectReason");
            return (Criteria) this;
        }

        public Criteria andRejectReasonIn(List<String> values) {
            addCriterion("reject_reason in", values, "rejectReason");
            return (Criteria) this;
        }

        public Criteria andRejectReasonNotIn(List<String> values) {
            addCriterion("reject_reason not in", values, "rejectReason");
            return (Criteria) this;
        }

        public Criteria andRejectReasonBetween(String value1, String value2) {
            addCriterion("reject_reason between", value1, value2, "rejectReason");
            return (Criteria) this;
        }

        public Criteria andRejectReasonNotBetween(String value1, String value2) {
            addCriterion("reject_reason not between", value1, value2, "rejectReason");
            return (Criteria) this;
        }


        public Criteria andLikeQuery(MonthRejectDtl record) {
            List<String> list = new ArrayList<String>();
            List<String> list2 = new ArrayList<String>();
            StringBuffer buffer = new StringBuffer();
            if (record.getId() != null && StrUtil.isNotEmpty(record.getId().toString())) {
                list.add("ifnull(id,'')");
            }
            if (record.getFkTaskId() != null && StrUtil.isNotEmpty(record.getFkTaskId().toString())) {
                list.add("ifnull(fk_task_id,'')");
            }
            if (record.getRejectDate() != null && StrUtil.isNotEmpty(record.getRejectDate().toString())) {
                list.add("ifnull(reject_date,'')");
            }
            if (record.getRejectReason() != null && StrUtil.isNotEmpty(record.getRejectReason().toString())) {
                list.add("ifnull(reject_reason,'')");
            }
            if (record.getId() != null && StrUtil.isNotEmpty(record.getId().toString())) {
                list2.add("'%" + record.getId() + "%'");
            }
            if (record.getFkTaskId() != null && StrUtil.isNotEmpty(record.getFkTaskId().toString())) {
                list2.add("'%" + record.getFkTaskId() + "%'");
            }
            if (record.getRejectDate() != null && StrUtil.isNotEmpty(record.getRejectDate().toString())) {
                list2.add("'%" + record.getRejectDate() + "%'");
            }
            if (record.getRejectReason() != null && StrUtil.isNotEmpty(record.getRejectReason().toString())) {
                list2.add("'%" + record.getRejectReason() + "%'");
            }
            buffer.append(" CONCAT(");
            buffer.append(StrUtil.join(",", list));
            buffer.append(")");
            buffer.append(" like CONCAT(");
            buffer.append(StrUtil.join(",", list2));
            buffer.append(")");
            if (!" CONCAT() like CONCAT()".equals(buffer.toString())) {
                addCriterion(buffer.toString());
            }
            return (Criteria) this;
        }

        public Criteria andLikeQuery2(String searchText) {
            List<String> list = new ArrayList<String>();
            StringBuffer buffer = new StringBuffer();
            list.add("ifnull(id,'')");
            list.add("ifnull(fk_task_id,'')");
            list.add("ifnull(reject_date,'')");
            list.add("ifnull(reject_reason,'')");
            buffer.append(" CONCAT(");
            buffer.append(StrUtil.join(",", list));
            buffer.append(")");
            buffer.append("like '%");
            buffer.append(searchText);
            buffer.append("%'");
            addCriterion(buffer.toString());
            return (Criteria) this;
        }

    }

    public static class Criteria extends GeneratedCriteria {
        protected Criteria() {
            super();
        }
    }

    public static class Criterion {
        private String condition;

        private Object value;

        private Object secondValue;

        private boolean noValue;

        private boolean singleValue;

        private boolean betweenValue;

        private boolean listValue;

        private String typeHandler;

        public String getCondition() {
            return condition;
        }

        public Object getValue() {
            return value;
        }

        public Object getSecondValue() {
            return secondValue;
        }

        public boolean isNoValue() {
            return noValue;
        }

        public boolean isSingleValue() {
            return singleValue;
        }

        public boolean isBetweenValue() {
            return betweenValue;
        }

        public boolean isListValue() {
            return listValue;
        }

        public String getTypeHandler() {
            return typeHandler;
        }

        protected Criterion(String condition) {
            super();
            this.condition = condition;
            this.typeHandler = null;
            this.noValue = true;
        }

        protected Criterion(String condition, Object value, String typeHandler) {
            super();
            this.condition = condition;
            this.value = value;
            this.typeHandler = typeHandler;
            if (value instanceof List<?>) {
                this.listValue = true;
            } else {
                this.singleValue = true;
            }
        }

        protected Criterion(String condition, Object value) {
            this(condition, value, null);
        }

        protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
            super();
            this.condition = condition;
            this.value = value;
            this.secondValue = secondValue;
            this.typeHandler = typeHandler;
            this.betweenValue = true;
        }

        protected Criterion(String condition, Object value, Object secondValue) {
            this(condition, value, secondValue, null);
        }
    }
}